if __name__ == '__main__':
    print("开始学习字典");

    xiao_ming = {"name": "小明",
                 "age": 18,
                 "gender": True,
                 "height": 180,
                 "weight": 85
                 }
    print(xiao_ming);

    print(xiao_ming["name"]);


    xiao_ming["score"] = 100;
    xiao_ming["weight"] = 86;

    print(xiao_ming);

    xiao_ming.pop("name");
    print(xiao_ming);
    #看字典的键值对
    print(len(xiao_ming))

    print("两个字典合并");
    #连个字典的合并
    my_info = {"name":"高河强","weight":185,"salary":22000};
    your_info = {"name":"高河强1","weight":180,"salary":22000,"favirate":"study"};
    #注意: 如果被合并的字典中包含已经存在的键值时，会覆盖原有的键值对。
    my_info.update(your_info);
    print(my_info);

    for k in my_info:
        print("key is %s,value is %s" %(k,my_info[k]));
